package jumpingnotes.model.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name = "deploy", catalog = "jumping_notes")
public class Deploy implements java.io.Serializable
{

	private Integer deployId;
	private Audio audio;
	private String vendor;
	private String model;
	private String deployType;
	private Integer subtype;
	private String uuid;
	private Integer playCount;
	private Integer downloadCount;
	private Date createTime;

	public Deploy()
	{
	}

	public Deploy(Audio audio, String vendor, String model)
	{
		this.audio = audio;
		this.vendor = vendor;
		this.model = model;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "deploy_id", unique = true, nullable = false)
	public Integer getDeployId()
	{
		return this.deployId;
	}

	public void setDeployId(Integer deployId)
	{
		this.deployId = deployId;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "audio_id", nullable = false)
	public Audio getAudio()
	{
		return this.audio;
	}

	public void setAudio(Audio audio)
	{
		this.audio = audio;
	}

	@Column(name = "vendor", nullable = false, length = 50)
	public String getVendor()
	{
		return this.vendor;
	}

	public void setVendor(String vendor)
	{
		this.vendor = vendor;
	}

	@Column(name = "model", nullable = false)
	public String getModel()
	{
		return this.model;
	}

	public void setModel(String model)
	{
		this.model = model;
	}

	@Column(name = "deploy_type", length = 50)
	public String getDeployType() 
	{
		return this.deployType;
	}
	
	public void setDeployType(String deployType) 
	{
		this.deployType = deployType;
	}
	
	@Column(name = "subtype")
	public Integer getSubtype()
	{
		return this.subtype;
	}

	public void setSubtype(Integer subtype)
	{
		this.subtype = subtype;
	}
	
	@Column(name = "uuid", length = 100)
	public String getUuid()
	{
		return this.uuid;
	}

	public void setUuid(String uuid)
	{
		this.uuid = uuid;
	}

	@Column(name = "play_count")
	public Integer getPlayCount()
	{
		return this.playCount;
	}

	public void setPlayCount(Integer playCount)
	{
		this.playCount = playCount;
	}
	
	@Column(name = "download_count")
	public Integer getDownloadCount()
	{
		return this.downloadCount;
	}

	public void setDownloadCount(Integer downloadCount)
	{
		this.downloadCount = downloadCount;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "create_time", nullable = false, length = 19)
	public Date getCreateTime()
	{
		return this.createTime;
	}

	public void setCreateTime(Date createTime)
	{
		this.createTime = createTime;
	}

}
